//
//  AWSRestConnection.h
//  cTypica
//
//  Created by David Kavanagh on 10/14/08.
//  Copyright 2008 directThought. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol AWSExceptionDelegate;

@interface AWSRestConnection : NSObject {
	NSString *accessId;
	NSString *secretKey;
	NSString *hostName;
	int maxRetries;
	id<AWSExceptionDelegate> errorDelegate;
@protected
	NSString *version;
	NSDateFormatter *formatter;
}

- (id)initWithAccessId:(NSString *)aId secretKey:(NSString *)sKey hostName:(NSString *)hName;

- (void)makeRequest:(NSString *)action parameters:(NSDictionary *)params delegate:(id)delegate;

- (NSString *)encodedURLParameterString:(NSString *)val;

@property(copy,readwrite) NSString *accessId;
@property(copy,readwrite) NSString *secretKey;
@property(copy,readwrite) NSString *hostName;
@property(assign,readwrite) int maxRetries;
@property(assign,readwrite) id<AWSExceptionDelegate> errorDelegate;
@end

@protocol AWSExceptionDelegate
- (void)connectionFailed:(NSString *)msg;
- (void)webServiceError:(NSString *)msg errorCode:(NSString *)errCode reqId:(NSString *)requestId;
@end
